package com.cheney.common.sensitive.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 脱敏配置类
 */
@Configuration
public class ConverterConfiguration {

    @Bean
    @ConfigurationPropertiesBinding
    public SensitiveConverter registerDesensitizationHandlerConverter(@Autowired ApplicationContext applicationContext) {
        return new SensitiveConverter(applicationContext);
    }

    @Bean
    @ConfigurationPropertiesBinding
    public SensitiveStrategyConverter registerDesensitizationStrategyConverter(@Autowired ApplicationContext applicationContext) {
        return new SensitiveStrategyConverter(applicationContext);
    }

}